<?php

namespace application\controllers;

use application\BaseController;
use fastphp\facade\Request;

class UploadController extends BaseController
{
    public function image()
    {
      $file =  Request::file('file');
      $res =  $file->save('static/upload/images');
      if (empty($res)){
          $this->json('上传图片失败',$res,400);
          exit();
      }
        $this->json('上传图片成功',$res);
    }
}